package com.gmall.user.feign;

import com.gmall.common.result.Result;
import com.gmall.model.user.UserAddress;
import com.gmall.model.user.UserInfo;
import com.gmall.user.feign.impl.UserApiFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(value = "service-user",fallback = UserApiFeignClientFallback.class)
public interface UserApiFeignClient {
    @GetMapping("api/user/getUserInfoByLoginName/{loginName}")
    public Result<UserInfo> getUserInfoByLoginName(@PathVariable String loginName);


    @GetMapping("api/user/findUserAddressListByUserId/{userId}")
    public List<UserAddress> findUserAddressListByUserId(@PathVariable Long userId);

    @GetMapping("api/user/findUserAddressList1")
    public List<UserAddress> findUserAddressList1(@RequestHeader Long userId);


    @GetMapping("api/user/findUserAddressList2/")
    public List<UserAddress> findUserAddressList2();
}
